package com.market.member.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.support.geo.Point;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.block.common.constant.AppRspCodeConstant;
import com.block.common.vo.ResponseVo;
import com.block.db.entity.MemberAreacityPosition;
import com.block.db.mapper.MemberAreacityPositionMapper;
import com.market.member.service.IMemberAreacityPositionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@Service
public class MemberAreacityPositionServiceImpl extends ServiceImpl<MemberAreacityPositionMapper, MemberAreacityPosition> implements IMemberAreacityPositionService {

    @Override
    public ResponseVo getSourceInfoByPosition(Double longitude,Double latitude) {
        JSONObject jsonObject = new JSONObject();
        List<MemberAreacityPosition> sourceInfoByPosition = baseMapper.getSourceInfoByPosition(longitude,latitude);
        jsonObject.put("sourceInfoByPosition", sourceInfoByPosition);
        return new ResponseVo(AppRspCodeConstant.SUCCESS, jsonObject);
    }
}
